<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        =====
        <hr>
        <father @qqq='show'></father>
    </div>
    <script type='text/javascript'>
        var son = {
            template: `<span @click='sShow'>我是son</span>`,
            data() {
                return {
                    son1: '我是son'
                }
            },
            methods: {
                sShow() {
                     this.$emit('ffff',this.son1)
                }
            }
        }

        var father = {
            data() {
                return {
                    ff: 'father',
                    tf:''
                }
            },
            template: `<h2 @click.self='fShow'>我还是father组件====<son @ffff='stfShow'></son>===={{tf}}===</h2>`,
            methods: {
                fShow() {
                    this.$emit('qqq', this.ff)
                },
                stfShow(message){
                    this.tf=message
                    console.log(33333);
                    
                }
            },
            components: {
                son
            }
        }




        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            components: {
                father
            },
            methods: {
                show(message) {
                    this.msg = message
                    console.log(1234);

                }
            }
        });
    </script>
</body>

</html>